<script setup lang="ts">
import { ref } from 'vue'
// 引入父组件传递过来的数据类型 以及 emits中定义的方法
import { appProps ,appEmits} from '../types/helloWorld'

// 接收父组件传递过来的数据
defineProps<appProps>()
const emit = defineEmits<appEmits>()

const updateAppTitle=()=>{
  emit('send-title','我来自子组件');
}

const count = ref(0)
</script>

<template>
  <h1>{{ msg }}</h1>
  <h2>父组件传过来的参数:{{ message,msg }}</h2>
  <input type="button" @click="updateAppTitle" value="子传父按钮">
  <div class="card">
    <button type="button" @click="count++">count is {{ count }}</button>
  </div>


   
</template>

<style scoped>
.read-the-docs {
  color: #888;
}
</style>
